﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.Entities;
using MAF;

namespace Domain
{
    public class ContentRepository
    {
        private IWorkspace _ws;

        public ContentRepository(IWorkspace ws)
        {
            _ws = ws;
        }

        public void Add(Content content)
        {
            _ws.Save(content);
        }

        public Content GetContent(Guid id)
        {
            return _ws.GetById<Content>(id);
        }

        public IList<Content> GetContents(IQuery q)
        {
            return _ws.GetByQuery<Content>(q);
        }
    }
}
